package com.supermarket.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.supermarket.dao.GoodsDao;
import com.supermarket.model.Goods;
import com.supermarket.model.Provider;
import com.supermarket.service.IGoodsFunction;
@Service
public class GoodsFunctionImpl implements IGoodsFunction {

	GoodsDao gDao;
	public GoodsDao getgDao() {
		return gDao;
	}

	@Autowired
	public void setgDao(GoodsDao gDao) {
		this.gDao = gDao;
	}


	
	
	public List<Goods> selectGoodsBypagination() {
		List<Goods>  list= gDao.selectGoodsByPagination();
		return list;
	}

	public void deleteById(Integer id) {
		gDao.deleteById(id);

	}

	public void addGoods(Goods good) {
		gDao.addGoods(good);

	}

	public List<Goods> queryGoods(String keyword) {
		// TODO Auto-generated method stub
		return gDao.queryGoods(keyword);
	}

	public void updateGoodsNum(Goods good) {
		gDao.updateGoodsNum(good);
		
	}

	public Goods selectGoodsById(Integer id) {
		// TODO Auto-generated method stub
		return gDao.selectGoodsById(id);
	}

	public void updateGoods(Goods good) {
		gDao.updateGoods(good);
		
	}

}
